package com.wangwei.modules.servlet.spring

import java.lang.annotation.ElementType
import java.lang.annotation.RetentionPolicy
import java.lang.annotation.Documented

enum class RequestMethod() {
	GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE
}


@Target(AnnotationTarget.CLASS)
@Retention
@MustBeDocumented
public annotation class Component(val value: String = "")

@Target(AnnotationTarget.CLASS)
@Retention
@MustBeDocumented
@Component
public annotation class Service(val value: String = "")

@Target(AnnotationTarget.CLASS)
@Retention
@MustBeDocumented
@Component
public annotation class Controller(val value: String = "")

@Target(AnnotationTarget.CLASS)
@Retention
@MustBeDocumented
@Controller("")
public annotation class RestController(val value: String = "")


@Target(AnnotationTarget.ANNOTATION_CLASS)
@Retention
public annotation class Mapping()

//@Target({ElementType.METHOD, ElementType.TYPE})
@Target(AnnotationTarget.FUNCTION)
@Retention
@MustBeDocumented
@Mapping
public annotation class RequestMapping(val value: String = ""
									   , val method: RequestMethod = RequestMethod.POST
									   , val params: String = ""
									   , val headers: String = ""
									   , val consumes: String = ""
									   , val produces: String = ""
)

//@Target({ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.METHOD, ElementType.ANNOTATION_TYPE})
@Target(AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FIELD, AnnotationTarget.FUNCTION)
@Retention
@MustBeDocumented
public annotation class Autowired(val required: Boolean = true)





@Target(AnnotationTarget.TYPE, AnnotationTarget.FUNCTION)
@Retention
@MustBeDocumented
public annotation class ResponseBody






